-
Notifications
You must be signed in to change notification settings - Fork 26
Add null-ckeck analyzer and code fix #43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
-Add the analyzer and code fix classes -Add related unit tests -Modify readme.md to showcase the new feature
…upport batch fixing
@s-arash, my apologies for not getting to this sooner! FWIW, we actually delivered this feature in the last update to Visual Studio 2015. So, you shouldn't need it C# Essentials. |
@DustinCampbell as far as I know, Visual Studio only looks for delegate invocation if (SomethingHappened != null) SomethingHappened(this, args);
// -->
SomethingHappened?.Invoke(this,args); This code fix looks for other cases where null conditional access can be used to simplify code. Unless I'm missing something obvious, that is the situation. |
Ah yes, you are correct. Sorry about that! |
@@ -19,6 +19,7 @@ | |||
<Reference Include="Microsoft.CodeAnalysis.Workspaces, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> | |||
<HintPath>..\..\packages\Microsoft.CodeAnalysis.Workspaces.Common.1.0.0\lib\net45\Microsoft.CodeAnalysis.Workspaces.dll</HintPath> | |||
</Reference> | |||
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My bad. Fixed it.
…ols.UnitTestFramework that somehow snuck in.
No problem! |
Is this going to get merged in?! |
-Add the analyzer and code fix classes
-Add related unit tests
-Modify readme.md to showcase the new feature
The analyzer looks for cases like this:
and the code fix converts them to:
It recognizes more complex syntax too.
--->